﻿#Co-Emperor Court Position Values
#This could use balancing in future patches and updates so very WIP.

co_emperor_court_position_opinion = 20
co_emperor_court_position_prestige_revoke_cost = 1000
co_emperor_court_position_prestige_salary = 2.0

co_emperor_court_position_aptitude_value = {
	value = 1
	add = {
		value = diplomacy
		multiply = 1.25
		max = 45
		desc = court_position_skill_diplomacy
	}
	add = {
		value = martial
		multiply = 1.25
		max = 55
		desc = court_position_skill_martial
	}
	add = {
		value = stewardship
		multiply = 0.75
		max = 35
		desc = court_position_skill_stewardship
	}
	add = {
		value = intrigue
		multiply = 0.75
		max = 35
		desc = court_position_skill_intrigue
	}
	add = {
		value = learning
		multiply = 0.75
		max = 25
		desc = court_position_skill_learning
	}
	add = {
		value = prowess
		multiply = 0.75
		max = 25
		desc = court_position_skill_prowess
	}
	if = {
		limit = {
			has_trait = born_in_the_purple
		}
		add = {
			value = 30
			desc = court_position_born_in_the_purple_trait
		}
	}
	if = {
		limit = {
			has_trait = august
		}
		add = {
			value = 10
			desc = court_position_august_trait
		}
	}
	if = {
		limit = {
			has_trait = strategist
		}
		add = {
			value = 10
			desc = court_position_strategist_trait
		}
	}
	if = {
		limit = {
			has_trait = diplomat
		}
		add = {
			value = 5
			desc = court_position_diplomat_trait
		}
	}
	if = {
		limit = {
			has_trait = administrator
		}
		add = {
			value = 5
			desc = court_position_administrator_trait
		}
	}
	if = {
		limit = {
			has_trait = brave
		}
		add = {
			value = 5
			desc = court_position_brave_trait
		}
	}
	if = {
		limit = {
			has_trait = diligent
		}
		add = {
			value = 5
			desc = court_position_diligent_trait
		}
	}
	if = {
		limit = {
			has_trait = just
		}
		add = {
			value = 5
			desc = court_position_just_trait
		}
	}
	if = {
		limit = {
			has_trait = scaly
		}
		add = {
			value = -10
			desc = court_position_scaly_trait
		}
	}
	if = {
		limit = {
			has_trait = lunatic
		}
		add = {
			value = -10
			desc = court_position_lunatic_trait
		}
	}
	if = {
		limit = {
			has_trait = wheezing
		}
		add = {
			value = -10
			desc = court_position_wheezing_trait
		}
	}
	if = {
		limit = {
			has_trait = weak
		}
		add = {
			value = -10
			desc = court_position_weak_trait
		}
	}
	if = {
		limit = {
			has_trait = bleeder
		}
		add = {
			value = -10
			desc = court_position_bleeder_trait
		}
	}
	if = {
		limit = {
			has_trait = bleeder
		}
		add = {
			value = -10
			desc = court_position_bleeder_trait
		}
	}
	if = {
		limit = {
			has_trait = shy
		}
		add = {
			value = -10
			desc = court_position_shy_trait
		}
	}
	if = {
		limit = {
			has_trait = reclusive
		}
		add = {
			value = -10
			desc = court_position_reclusive_trait
		}
	}
	if = {
		limit = {
			has_trait = craven
		}
		add = {
			value = -10
			desc = court_position_craven_trait
		}
	}
	add = court_position_aptitude_family_business_value
	add = court_position_aptitude_high_penalty_value
}

# Scripted value to determine whether an AI will hire/fire a position or not. Hires over 0, fires under -50. Look in _court_positions.info for more extensive documentation!
co_emperor_court_position_candidate_score_value = {
	value = 1
	add = scope:base_value
	add = court_position_candidate_score_base_value
	add = court_position_candidate_aptitude_value

	# scope:employee = {
	# 	# Does the liege have a better candidate that they should be hiring instead?
	# 	if = {
	# 		limit = {
	# 			scope:highest_available_aptitude.compare_value > scope:employee_aptitude.compare_value
	# 		}
	# 		add = -125
	# 	}
	# }	

	if = {
		limit = {
			scope:employee = { is_child_of = scope:liege }
		}
		add = 100
	}
	if = {
		limit = {
			scope:employee = { 
				is_female = yes
			}
			scope:liege.faith = {
				has_doctrine = doctrine_gender_male_dominated
			}	
		}
		add = -200
	}
	if = {
		limit = {
			scope:employee = { 
				is_close_or_extended_family_of = scope:liege 
				NOT = { is_child_of = scope:liege }
			}
			scope:liege = {
				any_child = { 
					is_adult = yes
					is_alive = yes 
					is_heir_of = scope:liege
				}
			}	
		}
		add = -200
	}
	if = {
		limit = {
			scope:employee = { 
				OR = {
					is_vassal_or_below_of = scope:liege 
					is_courtier_of = scope:liege 
				}
				NOT = { is_close_or_extended_family_of = scope:liege }
			}
			scope:liege = {
				any_child = { 
					is_adult = yes 
					is_alive = yes 
					is_heir_of = scope:liege
				}
			}	
		}
		add = -300
	}
	if = {
		limit = {
			scope:employee = { 
				has_trait = born_in_the_purple 
				is_child_of = scope:liege
			}
		}
		add = 100
	}
	if = {
		limit = {
			scope:employee = { 
				has_trait = born_in_the_purple 
				is_close_or_extended_family_of = scope:liege
				NOT = { is_child_of = scope:liege }
			}
		}
		add = 50
	}
	else_if = {
		limit = {
			scope:employee = { is_spouse_of = scope:liege }
		}
		add = 25
	}
	else_if = {
		limit = {
			scope:employee = { is_grandchild_of = scope:liege }
		}
		add = 75
	}
	else_if = {
		limit = {
			scope:employee = { is_great_grandchild_of = scope:liege }
		}
		add = 50
	}
	else_if = {
		limit = {
			scope:employee = { is_close_family_of = scope:liege }
		}
		add = 25
	}
	else_if = {
		limit = {
			scope:employee = { is_close_or_extended_family_of = scope:liege }
		}
		add = 15
	}
}